package com.tc.juc.design;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

/**
 * @Auther: tianchao
 * @Date: 2021/10/4 18:54
 * @Description:
 */
@Slf4j
public class TestOrderPark {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            LockSupport.park();
            log.info("1");
        },"t1");
        Thread t2 = new Thread(()->{
            log.info("2");
            log.info("t1状态: {}",t1.getState());
            LockSupport.unpark(t1);
        },"t2");
        t1.start();
        t2.start();
    }
}
